import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/user/login.vue')
  },
  {
    path: '/',
    name: 'layout',
    component: () => import('../views/layout.vue'),
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import('../views/home/home.vue')
      }, {
        path: '/discover',
        name: 'discover',
        component: () => import('../views/discover/index.vue')
      }, {
        path: '/user',
        name: 'user',
        component: () => import('../views/user/index.vue')
      }, {
        path: '/exercise',
        name: 'exercise',
        component: () => import('../views/exercise/index.vue')
      }
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
